package yunjiao.designpatterns.visitor.example1;

import lombok.Data;
import yunjiao.designpatterns.visitor.example1.items.ShopItem;

/**
 * TODO
 *
 * @author yangyunjiao
 */
@Data
public abstract class Customer {
    protected String name;

    public Customer(String name) {
        super();
        this.name = name;
    }

    public double calculateCost(ShopItem item) {
        double price = item.getPrice();
        double weight = item.getWeight();
        return (weight == 0.0d) ? price : price * weight;

    }

}
